home *** CD-ROM | disk | FTP | other *** search
- Path: news.mindspring.com!usenet
- From: wdnick@mindspring.com (William D. Nicholson)
- Newsgroups: comp.lang.c++
- Subject: Newbie Question about fprintf
- Date: Fri, 12 Jan 1996 07:32:50 GMT
- Organization: SCT
- Message-ID: <4d4o9k$6m9@brickbat.mindspring.com>
- Reply-To: wdnick@mindspring.com
- NNTP-Posting-Host: wdnick.mindspring.com
- X-Newsreader: Forte Free Agent 1.0.82
-
- OK. I'm taking an Intro to C class at college and I've ran into a
- stumper. At school we have a dot amtrix printer, I'm not sure what
- brand. And I'm using an HP DeskJet Plus at home. Also, at school we
- have Borland C++ 3.1 and I have 3.0. The following lines work fine at
- school, but at home....
-
- printf ("\nEnter length> ");
- fprintf (stdprn,"\nEnter length> ");
- scanf ("%lf", &length);
- printf ("Enter width> ");
- fprintf (stdprn,"\nEnter width> ");
- scanf ("%lf", &width);
- area = length * width;
- perim = (2 * length) + (2 * width);
- printf ("\nThe area is %f\n", area);
- fprintf (stdprn,"\nThe area is %f", area);
- printf ("The perimeter is %f\n\n", perim);
- fprintf (stdprn,"\nThe perimeter is %f\n", perim);
-
- At home, the output to the printer looks something like this...
-
- Enter length>
- Enter width>
- The area is x.xxxxx
-
- ...
-
- Is this a problem between the 3.0 and 3.1 compiler, or a problem with
- my printer? And either way, how can I fix it? The \n in the fprintf
- lines is moving to a new line like it should, but not the beginning.
-
-
- Thanks for any help...
-
-
- William D. Nicholson wdnick@mindspring.com
- Mechanical Engineering Student
- Southern College of Technology It is what you make it.
- Under heavy construction: http://www.mindspring.com/~wdnick/home.html
-
-